<?php
defined('_JEXEC') or die('Restricted access');
$session = & JFactory::getSession();

$fixed_route = $session->get('fixed_route', "");

if($fixed_route != ""){
    $begin = $this->begin;
    $end = $this->end;
}else{
    
    if ($this->from_dest == 0)
    {
        $begin = booking_helper::get_place_field($this->begin, 'title');
    }
    else
    {
        $begin = $this->begin;
    }
    if ($this->to_dest == 0)
    {
        $end = booking_helper::get_place_field($this->end, 'title');
    }
    else
    {
        $end = $this->end;
    }
}
?>

<link type="text/css" rel="stylesheet" href="<?php echo JURI::root(true); ?>/components/com_taxibooking/assets/calendar/css/jscal2.css" />
<link type="text/css" rel="stylesheet" href="<?php echo JURI::root(true); ?>/components/com_taxibooking/assets/calendar/css/border-radius.css" />
<!-- <link type="text/css" rel="stylesheet" href="src/css/reduce-spacing.css" /> -->

<script src="<?php echo JURI::root(true); ?>/components/com_taxibooking/assets/calendar/js/jscal2.js"></script>
<script src="<?php echo JURI::root(true); ?>/components/com_taxibooking/assets/calendar/js/unicode-letter.js"></script>

<?php if($session->get('fixed_route', '') == ""){ ?>
<!-- this must stay last so that English is the default one -->
<script src="<?php echo JURI::root(true); ?>/components/com_taxibooking/assets/calendar/js/lang/en.js"></script>
<!--<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php echo $this->elsettings->gmap_key; ?>" type="text/javascript"></script>-->
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<!--<script src="<?php echo JURI::root(true); ?>/components/com_taxibooking/assets/js/map.js"></script>-->
<script type="text/javascript">
    var directionDisplay;
    var directionsService = new google.maps.DirectionsService();

    function initialize() {

        directionsDisplay = new google.maps.DirectionsRenderer();
        var myOptions = {
            zoom: <?php echo $this->elsettings->map_zoom; ?>,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
        directionsDisplay.setMap(map);
        directionsDisplay.setPanel(document.getElementById('directions_panel'));

        calcRoute();
    }

    function calcRoute() {
        var start = document.getElementById('start').value;
        var end = document.getElementById('end').value;
        var request = {
            origin: start,
            destination: end,
            travelMode: google.maps.DirectionsTravelMode.DRIVING
        };
        directionsService.route(request, function(response, status) {
            if (status == google.maps.DirectionsStatus.OK) {
                directionsDisplay.setDirections(response);
            }
        });
    }
    google.maps.event.addDomListener(window, 'load', initialize);
</script>
<?php } ?>

<div id="booking" class="booking">

    <form name="book_taxi2" action="<?php echo $this->action ?>" method="post">

        <div class="sized_head">

            <b class="b1h"></b>
            <b class="b2h"></b>
            <b class="b3h"></b>
            <b class="b4h"></b>

            <div class="headh">
            </div>


            <div class="contenth">
                <div id="prev1">
                    <legend style="width: 231px;"><?php echo JText::_(BOOKING_FORM_STEP2_TEXT); ?></legend>
                    <center><u><?php echo JText::_('DETAILS'); ?></u></center><hr>

                    <?php echo JText::_('FROM') . ":<b> $begin </b><br>"; ?>
                    <?php echo JText::_('To') . "&nbsp;&nbsp;:<b> $end </b><br>"; ?>

                    <?php if ($this->returnjurney == 1)
                        echo "and <b>return.</b><br>\n"; ?>

                    <div class='price' id='price' style="text-align:center"><?php echo JText::_('PRICE'); ?>: <?php echo $this->elsettings->currency_symbol; ?><?php echo $this->formatted_price; ?> </div>


                    <input type='hidden' name='cprice' id='cprice' value='<?php echo $this->price; ?>'>
                    <input name='from_dest' type='hidden' value='<?php echo $this->from_dest; ?>'>
                    <input name='to_dest' type='hidden' value='<?php echo $this->to_dest; ?>'>
                    <input name='returntrip' type='hidden' value='<?php echo $this->returnjurney; ?>'>
                    <input name='vehicletype' type='hidden' value='<?php echo $this->vehicletype; ?>'>
                    <input name='selpsg' type='hidden' value='<?php echo $this->selpsg; ?>'>
                    <input name='suitcases' type='hidden' value='<?php echo $this->suitcases; ?>'>
                    <input name='infantseats' type='hidden' value='<?php echo $this->infantseats; ?>'>
                    <input name='chseats' type='hidden' value='<?php echo $this->chseats; ?>'>
                    <input name='boosterseats' type='hidden' value='<?php echo $this->boosterseats; ?>'>
                    <input name='selcarry' type='hidden' value='<?php echo $this->selcarry; ?>'>

                    <?php if($session->get('fixed_route', '') == ""){ ?>
                    <body onLoad="load();generateRoute();" onUnload="GUnload();">
                        <br /><br />
                        <?php if ($this->elsettings->map_active): ?>
                            <table cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td width="70%">
                                    <?php if ($this->elsettings->map_on_right == 0)
                                    {
 ?>
                                        <div id="map_canvas" style="width:<?php echo $this->elsettings->map_width; ?>px;height:<?php echo $this->elsettings->map_height; ?>px;"></div>
                                    <?php
                                    }
                                    else
                                    {
 ?>
                                        <div id="directions_panel" style="width:<?php echo $this->elsettings->dir_width; ?>px;height:<?php echo $this->elsettings->dir_height; ?>px;"></div>
<?php } ?>
                                    <input type="hidden" id="start" value="<?php echo implode(',', $session->get('lat_long_from', array())); ?>" />
                                    <input type="hidden" id="end" value="<?php echo implode(',', $session->get('lat_long_to', array())); ?>" />

                                </td>
                                <td width="30%" >
<?php if ($this->elsettings->map_on_right == 1)
                                    {
 ?>
                                        <div id="map_canvas" style="width:<?php echo $this->elsettings->map_width; ?>px;height:<?php echo $this->elsettings->map_height; ?>px"></div>
<?php }
                                    else
                                    { ?>
                                                    <div id="directions_panel" style="width:<?php echo $this->elsettings->dir_width; ?>px;height:<?php echo $this->elsettings->dir_height; ?>px;"></div>
<?php } ?>
                                            </td>
                                        </tr>
                                    </table>
                                    <?php endif; ?>
                        <?php } ?>


                        <div id='prev3'>

                            <table width="100%" border="0"><tr>
                                    <?php
                                    if (($this->elsettings->prepayment < 100) && ($this->elsettings->disabled != 1))
                                        echo "<td><label for='prepay'><input name='prepay' id='prepay' value='" . $this->elsettings->prepayment . "' type='checkbox' class='radio'>I will pay " . $this->elsettings->prepayment . "% ".JText::_("PERCENT_PAYMENT").".</label>

                    </td>";
                                    else
                                        echo "<input name='prepay' id='prepay' type='hidden' value=100>";
                                    ?>

                                    <td align="right" valign="bottom">

                                        <a href="<?php echo JRoute::_('index.php?option=com_taxibooking', false); ?>">

<?php echo JText::_('Edit directions'); ?></a></td></tr></table>

                        </div>
                </div>

                <div id="prev1">
                    <center><u><?php echo JText::_(DETAILED_INFORMATION); ?></u><hr>
                        <br>

                        <table border=1 class='bordertable'>
                            <tr>
                                <td width='50%'><?php echo JText::_('NAME'); ?></td>
                                <td width='50%' align='center'>
                                    <input STYLE="width: 190px" name="name" type="text" id="name" value="<?php echo $session->get('name', ''); ?>"/>
    							<?php echo JText::_(SELECT_GENDER) ?>
                                    <select name="title" id="title">
                                        <option value="Male" selected="selected">Male</option>
                                        <option value="Female">Female</option>
                                        <!--
                                                                            <option>Ms.</option>
                                                                            <option>Miss. </option>
                                                                            <option>Dr.</option>
                                        -->
                                    </select>&nbsp;

                                    <br/>
                                    <span style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><i><?php echo $session->get('name_error', ''); ?></i></b></span>
                                </td>
                            </tr>
                            <tr>
                                <td><?php echo JText::_('SURNAME'); ?></td>
                                <td align='center'><input STYLE="width: 98%" name="surname" type="text" id="surname" value="<?php echo $session->get('surname', ''); ?>"/>
                                    <span style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><i><?php echo $session->get('surname_error', ''); ?></i></b></span>
                                </td>
                            </tr>

                            <tr>
                                <td><?php echo JText::_('EMAIL'); ?></td>
                                <td align='center'><input STYLE="width: 98%" name="email" type="text" id="email" value="<?php echo $session->get('email', ''); ?>"/>
                                    <span style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><i><?php echo $session->get('email_error', ''); ?></i></b></span>
                                </td>
                            </tr>
                            <tr>
                                <td><?php echo JText::_('PHONE'); ?></td>
                                <td align='center'><input STYLE="width: 98%" name="phone" type="text" id="phone" value="<?php echo $session->get('phone', ''); ?>"/>
                                    <span style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><i><?php echo $session->get('phone_error', ''); ?></i></b></span>
                                </td>
                            </tr>
                            <tr>
                                <td><?php echo JText::_(PICKUP_DATE_TIME); ?> <b><?php echo $begin ?></b> 	</td>
                                <td align='center'>
                                        <?php echo getCalendar($session->get('date1', ''), "orderdate", "orderdate", '%d/%m/%Y', 'readonly="readonly"', $this->returnjurney); ?>
                                        <?php
                                        $time1 = $session->get('time1', '');
                                        $time1Arr = explode(':', $time1);
                                        ?>
                                    <select name='selPtHr1' class='timesize'>
                                        <?php
                                        for ($i = 0; $i <= 23; $i++)
                                        {
                                            if ($i < 10)
                                            {
                                                $i = "0$i";
                                            }
                                            $selected = '';
                                            if ($time1Arr[0] == "$i")
                                            {
                                                $selected = ' selected';
                                            }
                                            echo '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>';
                                        }
                                        ?>
                                    </select> :

                                    <select name='selPtMn1' class='timesize'>
                                        <?php
                                        for ($i = 0; $i <= 55; $i = $i + 5)
                                        {
                                            if ($i < 10)
                                            {
                                                $i = "0$i";
                                            }
                                            $selected = '';
                                            if ($time1Arr[1] == "$i")
                                            {
                                                $selected = ' selected';
                                            }

                                            echo '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>';
                                        }
                                        ?>
                                        </select>

<?php //echo DatePicker(1);  ?>
                                        <br />
                                        <span style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><i><?php echo $session->get('date_error', ''); ?></i></b></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan=2 align='center'><b><?php echo JText::_('FROM'); ?>:</b></td>
                                        </tr>
<?php
                                        switch ($this->from_dest)
                                        {
                                            case 0:
?>
                                                <tr class='tr_col_from' valign='top'>
                                                    <td><br><b><?php echo $begin ?></b><input name="begin" id="begin" type="hidden" value='<?php echo $this->begin ?>'></td>
                                                    <td>
                                                        <table style="width: 100%;">
                                                            <tr><td width='100px'><?php echo JText::_('FLIGHT'); ?>:</td>
                                                                <td>
                                                                    <textarea name="PickupAddr1" id="PickupAddr1" rows="3" cols="39"><?php echo $session->get('PickupAddr1', ''); ?></textarea>
                                                                </td>
                                                            </tr>
                                                            <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                    <i><?php echo $session->get('PickupAddr1_error', ''); ?></i>
                                                                </th>
                                                            </tr>

                                                                                <!--tr><td width='100px'><?php echo JText::_('ARRIVING FROM'); ?>:</td>
                                                                                        <td><input name="PickupAddr2" id="PickupAddr2" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr2', ''); ?>"></td>
                                                                                </tr>
                                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                                        <i><?php echo $session->get('PickupAddr2_error', ''); ?></i>
                                                                                        </th>
                                                                                </tr>
                                                                                <tr><td width='100px'><?php echo JText::_('TERMINAL'); ?>:</td>
                                                                                        <td><input name="PickupAddr3" id="PickupAddr3" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr3', ''); ?>"></td>
                                                                                </tr>
                                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                                        <i><?php echo $session->get('PickupAddr3_error', ''); ?></i>
                                                                    </th>
                                                            </tr-->
                                                        </table>
                                                    </td>
                                                </tr>
<?php
                                                break;

                                            case 1:
?>
                                                <tr class='tr_col_from' valign='top'>
                                                    <td><br><?php echo JText::_('ADDRESS INFO'); ?>:<br><br><b><?php echo $begin ?></b><input name="begin" id="begin" type="hidden" value='<?php echo $this->begin ?>'></td>
                                <td>
                                    <table>  
                                        <tr>
                                            <td><?php echo JText::_('POSTCODE'); ?>:</td>
                                            <td>
<?php
                                                if ($session->get('postcode1', '') != '')
                                                {
                                                    echo $session->get('postcode1', '');
                                                }
?>
                                            </td>
                                        </tr>

                                        <tr><td width='100px'><?php echo JText::_('STREET'); ?>:</td>
                                            <td><input name="PickupAddr1" id="PickupAddr1" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr1', $session->get('street1', '')); ?>"></td>
                                        </tr>
                                        <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <i><?php echo $session->get('PickupAddr1_error', ''); ?></i>
                                            </th>
                                        </tr>

                                        <tr><td width='100px'><?php echo JText::_('TOWN'); ?>:</td>

                                            <td><input name="PickupAddr2" id="PickupAddr2" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr2', $session->get('town1', $this->elsettings->default_city)); ?>"></td>

                                        </tr>

                                        <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                <i><?php echo $session->get('PickupAddr2_error', ''); ?></i>
                                                    </th>
                                                </tr>

<?php if ($session->get('county1', '') != '')
                                                {
 ?>
                                            <tr>

                                                <td><?php echo JText::_('COUNTY'); ?>:</td>

                                                        <td>

<?php echo $session->get('county1', ''); ?>

                                                        </td>
                                                    </tr>
<?php } ?>

                                                <?php if ($session->get('district1', '') != '')
                                                { ?>
                                            <tr>

                                                <td><?php echo JText::_('DISTRICT'); ?>:</td>

                                                        <td>

<?php echo $session->get('district1', ''); ?>

                                                        </td>
                                                    </tr>
<?php } ?>

                                                <tr><td width='100px'><?php echo JText::_('COUNTRY'); ?>:</td>
                                                    <td><input name="PickupAddr3" id="PickupAddr3" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr3', $session->get('country1', $this->elsettings->default_country)); ?>"></td>
                                                </tr>
                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                        <i><?php echo $session->get('PickupAddr3_error', ''); ?></i>
                                                                </th>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>

<?php
                                                break;
                                            case 2:
?>

                                                <tr class='tr_col_from' valign='top'>
                                                    <td><br><?php echo JText::_('SEAPORT INFO'); ?>:<br><br><b><?php echo $begin ?></b><input name="begin" id="begin" type="hidden" value='<?php echo $this->begin ?>'></td>
                                                    <td>
                                                        <table>
                                                            <tr><td width='100px'><?php echo JText::_('VESSEL'); ?>:</td>
                                                                <td><input name="PickupAddr1" id="PickupAddr1" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr1', ''); ?>"></td>
                                                            </tr>
                                                            <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                    <i><?php echo $session->get('PickupAddr1_error', ''); ?></i>
                                                                </th>
                                                            </tr>
                                                            <tr><td width='100px'><?php echo JText::_('FROM'); ?>:</td>
                                                                <td><input name="PickupAddr2" id="PickupAddr2" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr2', ''); ?>"></td>
                                                            </tr>
                                                            <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                    <i><?php echo $session->get('PickupAddr2_error', ''); ?></i>
                                                                </th>
                                                            </tr>
                                                            <tr><td width='100px'><?php echo JText::_('DOCK'); ?>:</td>
                                                                <td><input name="PickupAddr3" id="PickupAddr3" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr3', ''); ?>"></td>
                                                            </tr>



                                                            <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">

                                                                    <i><?php echo $session->get('PickupAddr3_error', ''); ?></i>

                                                                </th>

                                                            </tr>

                                                        </table>
                                                    </td>
                                                </tr>
                            <?php
                                            }
                            ?>
                                            <tr>
                                                <td colspan=2 align='center'><b><?php echo JText::_('TO'); ?>:</b></td>
                                            </tr>

<?php
                                            switch ($this->to_dest)
                                            {
                                                case 0:
?>
                                                    <tr class='tr_col_to' valign='top'>
                                                        <td><br><b><?php echo $end ?></b><input name="end" id="end" type="hidden" value='<?php echo $this->end ?>'></td>
                                                        <td>
                                                            <table style="width: 100%;">
                                                                <tr><td width='100px'><?php echo JText::_('FLIGHT'); ?>:</td>
                                                                    <td>
                                                                        <textarea name="PickupAddr4" id="PickupAddr4" rows="3" cols="39"><?php echo $session->get('PickupAddr4', ''); ?></textarea>
                                                                    </td>
                                                                </tr>
                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                        <i><?php echo $session->get('PickupAddr4_error', ''); ?></i>
                                                                    </th>
                                                                </tr>
                                                                <!--tr><td width='100px'><?php echo JText::_('TO'); ?>:</td>
                                                                        <td><input name="PickupAddr5" id="PickupAddr5" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr5', ''); ?>"></td>
                                                                </tr>
                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                        <i><?php echo $session->get('PickupAddr5_error', ''); ?></i>
                                                                        </th>
                                                                </tr>
                                                                <tr><td width='100px'><?php echo JText::_('TERMINAL'); ?>:</td>
                                                                        <td><input name="PickupAddr6" id="PickupAddr6" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr6', ''); ?>"></td>
                                                                </tr>
                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                                        <i><?php echo $session->get('PickupAddr6_error', ''); ?></i>
                                                                        </th>
                                                                </tr-->

                                                            </table>
                                                        </td>
                                                    </tr>
<?php
                                                    break;

                                                case 1:
?>
                                                    <tr class='tr_col_to' valign='top'>
                                                        <td><br><?php echo JText::_('ADDRESS INFO'); ?>:<br><br><b><?php echo $end ?></b><input name="end" id="end" type="hidden" value='<?php echo $this->end ?>'></td>

                                                        <td>

                                                            <table>
                                                                <tr>

                                                                    <td><?php echo JText::_('POSTCODE'); ?>:</td>

                                                <td>

<?php
                                                    if ($session->get('postcode2', '') != '')
                                                    {

                                                        echo $session->get('postcode2', '');
                                                    }
?>

                                                </td>
                                            </tr>

                                            <tr><td width='100px'><?php echo JText::_('STREET'); ?>:</td>
                                                <td><input name="PickupAddr4" id="PickupAddr4" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr4', $session->get('street2', '')); ?>"></td>

                                            </tr>
                                            <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">
                                                    <i><?php echo $session->get('PickupAddr4_error', ''); ?></i>

                                                </th>

                                            </tr>

                                            <tr><td width='100px'><?php echo JText::_('TOWN'); ?>:</td>

                                                <td><input name="PickupAddr5" id="PickupAddr5" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr5', $session->get('town2', $this->elsettings->default_city)); ?>"></td>

                                            </tr>

                                            <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">

                                                    <i><?php echo $session->get('PickupAddr5_error', ''); ?></i>

                                                        </th>

                                                    </tr>

                                                <?php if ($session->get('county2', '') != '')
                                                    { ?>
                                                <tr>

                                                    <td><?php echo JText::_('COUNTY'); ?>:</td>

                                                            <td>

<?php echo $session->get('county2', ''); ?>

                                                            </td>
                                                        </tr>
<?php } ?>

                                                <?php if ($session->get('district2', '') != '')
                                                    { ?>
                                                <tr>

                                                    <td><?php echo JText::_('DISTRICT'); ?>:</td>

                                                            <td>

<?php echo $session->get('district2', ''); ?>

                                                            </td>
                                                        </tr>
<?php } ?>


                                                    <tr><td width='100px'><?php echo JText::_('COUNTRY'); ?>:</td>

                                                        <td><input name="PickupAddr6" id="PickupAddr6" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr6', $session->get('country2', $this->elsettings->default_country)); ?>"></td>

                                                    </tr>

                                                    <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">

                                                            <i><?php echo $session->get('PickupAddr6_error', ''); ?></i>

                                                        </th>

                                                    </tr>

                                                </table>

                                            </td>

                                        </tr>

<?php
                                                    break;

                                                case 2:
?>

                                                    <tr class='tr_col_to' valign='top'>

                                                        <td><br><?php echo JText::_('SEAPORT INFO'); ?>:<br><br><b><?php echo $end ?></b><input name="end" id="end" type="hidden" value='<?php echo $this->end ?>'></td>

                                                        <td>

                                                            <table>

                                                                <tr><td width='100px'><?php echo JText::_('VESSEL'); ?>:</td>

                                                                    <td><input name="PickupAddr4" id="PickupAddr4" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr4', ''); ?>"></td>

                                                                </tr>



                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">

                                                                        <i><?php echo $session->get('PickupAddr4_error', ''); ?></i>

                                                                    </th>

                                                                </tr>

                                                                <tr><td width='100px'><?php echo JText::_('TO'); ?>:</td>

                                                                    <td><input name="PickupAddr5" id="PickupAddr5" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr5', ''); ?>"></td>

                                                                </tr>



                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">



                                                                        <i><?php echo $session->get('PickupAddr5_error', ''); ?></i>

                                                                    </th>

                                                                </tr>



                                                                <tr><td width='100px'><?php echo JText::_('DOCK'); ?>:</td>

                                                                    <td><input name="PickupAddr6" id="PickupAddr6" maxlength="40" onchange="f(this)" type="text" value="<?php echo $session->get('PickupAddr6', ''); ?>"></td>

                                                                </tr>

                                                                <tr><th colspan="2" style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;">

                                                                        <i><?php echo $session->get('PickupAddr6_error', ''); ?></i>

                                                                    </th>

                                                                </tr>

                                                            </table>

                                                        </td>

                                                    </tr>

<?php
                                                }

                                                if ($this->returnjurney == 1)
                                                {
?>


                                                    <tr>

                                                        <td><?php echo JText::_('RETURN PICKUP DATE FROM '); ?> <b><?php echo $end ?></b> 	</td>

                                                <td align='center'>


<?php echo getCalendar($session->get('date2', ''), "orderdatereturn", "orderdatereturn", '%d/%m/%Y', 'readonly="readonly"', $this->returnjurney); ?>

                                        <?php
                                                    $time2 = $session->get('time2', '');

                                                    $time2Arr = explode(':', $time2);
                                        ?>

                                                <select name='selPtHr2' class='timesize'>

                                        <?php
                                                    for ($i = 0; $i <= 23; $i++)
                                                    {


                                                        if ($i < 10)
                                                        {

                                                            $i = "0$i";
                                                        }

                                                        $selected = '';

                                                        if ($time2Arr[0] == "$i")
                                                        {


                                                            $selected = ' selected';
                                                        }

                                                        echo '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>';
                                                    }
                                        ?>

                                                </select> :

                                                <select name='selPtMn2' class='timesize'>

                                        <?php
                                                    for ($i = 0; $i <= 55; $i = $i + 5)
                                                    {

                                                        if ($i < 10)
                                                        {

                                                            $i = "0$i";
                                                        }

                                                        $selected = '';



                                                        if ($time2Arr[1] == "$i")
                                                        {

                                                            $selected = ' selected';
                                                        }

                                                        echo '<option value="' . $i . '" ' . $selected . '>' . $i . '</option>';
                                                    }
                                        ?>

                                                    </select>


<?php //echo DatePicker(2);   ?>


                                                    <br />


                                                    <span style="color: #ff0000; font-size: 8pt; font-family: Verdana, Arial, Helvetica, sans-serif;"><b><i><?php echo $session->get('return_date_error', ''); ?></i></b></span>


                                                    <div></div>

                                                </td>

                                            </tr>

<?php
                                                }
?>

                                                <tr>

                                                    <td><?php echo JText::_('MESSAGE'); ?></td>

                                                    <td align='center'><textarea name="message" value="" cols="64" rows="3"><?php echo $session->get('message', ''); ?></textarea></td>

                                                </tr>

                                            </table>

                                        </center>


                                        <div id='prev2' align=center>	</div>

                                        <div id='prev3'>* <?php echo JText::_(FILL_ALL_FIELDS) ?></div>

                                    </div>



                                    <br><br>

                <?php
                                                if ($this->elsettings->paypal_enabled == 0 && $this->elsettings->ncipay_enabled == 0 && $this->elsettings->cash_enabled == 0)
                                                {
                                                    echo JText::_("PAYMENT_METHOD_DISABLED");
                                                }
                                                else
                                                {
                                                    echo '<center>';
                                                    if ($this->elsettings->paypal_enabled == 1)
                                                    {
                                                        echo '<input type="submit" name="Submitpaypal" value="' . JText::_('PAYPAL_PAY') . '" title="' . JText::_('PAYPAL_PAY') . '" class="buttons" />';
                                                    }
                                                    if ($this->elsettings->auth_enabled == 1)
                                                    {
                                                        echo '<input type="submit" name="Submitanzpay" value="' . JText::_('ANZ_PAY') . '" title="' . JText::_('ANZ_PAY') . '" class="buttons" />';
                                                    }
                                                    if ($this->elsettings->ncipay_enabled == 1)
                                                    {
                                                        echo '<input type="submit" name="Submitncipay" value="' . JText::_('NCIPAY_PAY') . '" title="' . JText::_('NCIPAY_PAY') . '" class="buttons" />';
                                                    }
                                                    if ($this->elsettings->cash_enabled == 1)
                                                    {
                                                        echo '<input type="submit" name="SubmitCash" value="' . JText::_('CASH_PAY') . '" title="' . JText::_('CASH_PAY') . '" class="buttons" />';
                                                    }
                                                    echo '</center>';
                                                }

//			if ($this->elsettings->disabled==0){
//                            echo "
//
//			<center>
//                            <input name='Submit' value='Pay by Card' type='submit' title='Pay by Card' class='buttons' />
//                            <input name='SubmitCash' value='Pay Cash' type='submit' title='Pay Cash' class='buttons' />
//                            </center>";
//                        }else {
//
//                                    echo "<center><input name='SubmitCash' value='Pay Cash' type='submit' title='Pay Cash' class='buttons' /></center>";
//
//                        }
                ?>

                                                <br><br><br>

                                            </div>


                                            <b class="b4bh"></b>	<b class="b3bh"></b>	<b class="b2bh"></b>	<b class="b1h"></b>

                                        </div>


<?php echo JHTML::_('form.token'); ?>
                                                        <input type="hidden" name="option" value="com_taxibooking" />
                                                        <input type="hidden" name="task" value="previewOrder" />

                                                    </form>

                                                </div>

<?php /* //debug info see also bottom of page - may be used as Summary of Charges
                                                  debug_info('distance::', $this->dist_miles.' '.$this->elsettings->distance_unit);
                                                  debug_info('price_per_unit_distance::', $this->elsettings->price_per_unit_distance);
                                                  debug_info('cost_per_call (initial charge)::', $this->elsettings->cost_per_call);
                                                  debug_info('mpv_price (charge added for bigger vehicle)::', $this->elsettings->mpv_price);
                                                  debug_info('seat8_price (charge added for 8 seat vehicle)::', $this->elsettings->seat8_price);

                                                  if($this->infantseats > 0){
                                                  debug_info('infant_seat_price::', $this->elsettings->infant_seat_price);
                                                  }
                                                  if($this->chseats > 0){
                                                  debug_info('child_seat_price::', $this->elsettings->child_seat_price);
                                                  }
                                                  if($this->boosterseats > 0){
                                                  debug_info('booster_seat_price::', $this->elsettings->booster_seat_price);
                                                  }
                                                 */ ?>

<?php

                                                function DatePicker($first)
                                                {
                                                    //	$date_time = "10-28-2008";
                                                    if ($first == 1)
                                                    {
                                                        //		$date_time = "<input STYLE='width: 45%' name='date1' type='text' id='date1' value='".date('m-d-Y',time()+(24*60*60))."'>&nbsp;<input STYLE='width: 25%' name='time1' type='text' id='time1' value='".date ('H:i')."'/>";

                                                        $date_time = "<script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>";
                                                        $date_time .= "<select name='selPtHr1' class='timesize'>
                                <option value='00'>00</option><option value='01'>01</option><option value='02'>02</option><option value='03'>03</option><option value='04'>04</option><option value='05'>05</option><option value='06'>06</option><option value='07'>07</option><option value='08'>08</option><option value='09'>09</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option><option value='13'>13</option><option value='14'>14</option><option value='15'>15</option><option value='16'>16</option><option value='17'>17</option><option value='18'>18</option><option value='19'>19</option><option value='20'>20</option><option value='21'>21</option><option value='22'>22</option><option value='23'>23</option>
                                </select> :                  

                                <select name='selPtMn1' class='timesize'>
                                <option value='00'>00</option><option value='05'>05</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option><option value='45'>45</option><option value='50'>50</option><option value='55'>55</option>
                                </select>";
                                                    }
                                                    else
                                                    {
                                                        //		$date_time = "<input STYLE='width: 45%' disabled=true name='date2' type='text' id='date2' value='".date('m-d-Y',time()+(7*24*60*60))."'>&nbsp;<input STYLE='width: 25%' disabled=true name='time2' type='text' id='time2' value='".date ('H:i')."'>";
                                                        $date_time = "<script>DateInput('orderdatereturn', true, 'DD-MON-YYYY')</script>";
                                                        $date_time .= "<select id='selPtHr2' name='selPtHr2' class='timesize'>
                                <option value='00'>00</option><option value='01'>01</option><option value='02'>02</option><option value='03'>03</option><option value='04'>04</option><option value='05'>05</option><option value='06'>06</option><option value='07'>07</option><option value='08'>08</option><option value='09'>09</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option><option value='13'>13</option><option value='14'>14</option><option value='15'>15</option><option value='16'>16</option><option value='17'>17</option><option value='18'>18</option><option value='19'>19</option><option value='20'>20</option><option value='21'>21</option><option value='22'>22</option><option value='23'>23</option>
                                </select> :                  
                                <select id='selPtMn2' name='selPtMn2' class='timesize'>
                                <option value='00'>00</option><option value='05'>05</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option><option value='45'>45</option><option value='50'>50</option><option value='55'>55</option>
                                </select>";
                                                    }
                                                    return $date_time;
                                                }

                                                function getCalendar($value, $name, $id, $format = '%Y-%m-%d', $attribs = null, $returnjurney = 0)
                                                {
                                                    JHTML::_('behavior.calendar'); //load the calendar behavior

                                                    if (is_array($attribs))
                                                    {
                                                        $attribs = JArrayHelper::toString($attribs);
                                                    }

                                                    $document = & JFactory::getDocument();
                                                    $html = '';

                                                    if ($name == 'orderdate')
                                                    {

                                                        $html .= '
                <input type="text" name="' . $name . '" id="' . $id . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" ' . $attribs . ' />
                <button id="orderdate_img">...</button>
                <script type="text/javascript">
                  RANGE_CAL_1 = new Calendar({
                          inputField: "orderdate",
                          dateFormat: "%d/%m/%Y",
                          trigger: "orderdate_img",
                          bottomBar: false,
                          weekNumbers: true,
                            titleFormat: "%B %Y",
                            min: new Date(),';

                                                        if ($returnjurney == 1)
                                                        {
                                                            $html .= 'onSelect: function() {
                                  var date = Calendar.intToDate(this.selection.get()+1);
                                  RANGE_CAL_2.args.min = date;
                                  RANGE_CAL_2.redraw();
                                  this.hide();
                          }
                  });
                </script>';
                                                        }
                                                        else
                                                        {
                                                            $html .= 'onSelect: function() {
                                  this.hide();
                          }
                  });
                </script>';
                                                        }

                                                        return $html;
                                                    }

                                                    if ($name == 'orderdatereturn')
                                                    {

                                                        return '<input type="text" name="' . $name . '" id="' . $id . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" ' . $attribs . ' />
                <button id="orderdatereturn_img">...</button>

                <script type="text/javascript">
                  RANGE_CAL_2 = new Calendar({
                          inputField: "orderdatereturn",
                          dateFormat: "%d/%m/%Y",
                          trigger: "orderdatereturn_img",
                          bottomBar: false,
                          weekNumbers: true,
                            titleFormat: "%B %Y",
                            min: new Date(),
                          onSelect: function() {
                                  this.hide();
                          }
                  });
                </script>';
                                                    }
                                                }

                                                /* function debug_info($info, $val) { //debug info or Summary of Charges display
                                                  echo '<font color="red">&nbsp;&nbsp;>> '.$info.'</font> '.$val.'<br>';
                                                  } */
?>